<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToAsm.SPARC.CodeGen.Base</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-2"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier">InstrBlock</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-3"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#CondCode"><span class="hs-identifier">CondCode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-4"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#ChildCode64"><span class="hs-identifier">ChildCode64</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Amode"><span class="hs-identifier">Amode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Register"><span class="hs-identifier">Register</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#setFormatOfRegister"><span class="hs-identifier">setFormatOfRegister</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#getRegisterReg"><span class="hs-identifier">getRegisterReg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#mangleIndexTree"><span class="hs-identifier">mangleIndexTree</span></a></span><span>
</span><span id="line-12"></span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">where</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Instr.html"><span class="hs-identifier">GHC.CmmToAsm.SPARC.Instr</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Cond.html"><span class="hs-identifier">GHC.CmmToAsm.SPARC.Cond</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.AddrMode.html"><span class="hs-identifier">GHC.CmmToAsm.SPARC.AddrMode</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Regs.html"><span class="hs-identifier">GHC.CmmToAsm.SPARC.Regs</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Format.html"><span class="hs-identifier">GHC.CmmToAsm.Format</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html"><span class="hs-identifier">GHC.Platform.Reg</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Regs.html"><span class="hs-identifier">GHC.Platform.Regs</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Ppr.Expr.html"><span class="hs-identifier">GHC.Cmm.Ppr.Expr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- For Outputable instances</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- | 'InstrBlock's are the insn sequences generated by the insn selectors.</span><span>
</span><span id="line-35"></span><span class="hs-comment">--      They are really trees of insns to facilitate fast appending, where a</span><span>
</span><span id="line-36"></span><span class="hs-comment">--      left-to-right traversal yields the insns in the correct order.</span><span>
</span><span id="line-37"></span><span class="hs-comment">--</span><span>
</span><span id="line-38"></span><span class="hs-keyword">type</span><span> </span><span id="InstrBlock"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-var">InstrBlock</span></a></span></span><span>
</span><span id="line-39"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Instr.html#Instr"><span class="hs-identifier hs-type">Instr</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | Condition codes passed up the tree.</span><span>
</span><span id="line-43"></span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span class="hs-keyword">data</span><span> </span><span id="CondCode"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#CondCode"><span class="hs-identifier hs-var">CondCode</span></a></span></span><span>
</span><span id="line-45"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="CondCode"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#CondCode"><span class="hs-identifier hs-var">CondCode</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Cond.html#Cond"><span class="hs-identifier hs-type">Cond</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-type">InstrBlock</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">-- | a.k.a \&quot;Register64\&quot;</span><span>
</span><span id="line-49"></span><span class="hs-comment">--      Reg is the lower 32-bit temporary which contains the result.</span><span>
</span><span id="line-50"></span><span class="hs-comment">--      Use getHiVRegFromLo to find the other VRegUnique.</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="hs-comment">--      Rules of this simplified insn selection game are therefore that</span><span>
</span><span id="line-53"></span><span class="hs-comment">--      the returned Reg may be modified</span><span>
</span><span id="line-54"></span><span class="hs-comment">--</span><span>
</span><span id="line-55"></span><span class="hs-keyword">data</span><span> </span><span id="ChildCode64"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#ChildCode64"><span class="hs-identifier hs-var">ChildCode64</span></a></span></span><span>
</span><span id="line-56"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="ChildCode64"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#ChildCode64"><span class="hs-identifier hs-var">ChildCode64</span></a></span></span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-type">InstrBlock</span></a></span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="GHC.Platform.Reg.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- | Holds code that references a memory address.</span><span>
</span><span id="line-62"></span><span class="hs-keyword">data</span><span> </span><span id="Amode"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Amode"><span class="hs-identifier hs-var">Amode</span></a></span></span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="Amode"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Amode"><span class="hs-identifier hs-var">Amode</span></a></span></span><span>
</span><span id="line-64"></span><span>                </span><span class="hs-comment">-- the AddrMode we can use in the instruction</span><span>
</span><span id="line-65"></span><span>                </span><span class="hs-comment">--      that does the real load\/store.</span><span>
</span><span id="line-66"></span><span>                </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.AddrMode.html#AddrMode"><span class="hs-identifier hs-type">AddrMode</span></a></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span>                </span><span class="hs-comment">-- other setup code we have to run first before we can use the</span><span>
</span><span id="line-69"></span><span>                </span><span class="hs-comment">--      above AddrMode.</span><span>
</span><span id="line-70"></span><span>                </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-type">InstrBlock</span></a></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- | Code to produce a result into a register.</span><span>
</span><span id="line-76"></span><span class="hs-comment">--      If the result must go in a specific register, it comes out as Fixed.</span><span>
</span><span id="line-77"></span><span class="hs-comment">--      Otherwise, the parent can decide which register to put it in.</span><span>
</span><span id="line-78"></span><span class="hs-comment">--</span><span>
</span><span id="line-79"></span><span class="hs-keyword">data</span><span> </span><span id="Register"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Register"><span class="hs-identifier hs-var">Register</span></a></span></span><span>
</span><span id="line-80"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="Fixed"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Fixed"><span class="hs-identifier hs-var">Fixed</span></a></span></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Format.html#Format"><span class="hs-identifier hs-type">Format</span></a></span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-type">InstrBlock</span></a></span><span>
</span><span id="line-81"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="Any"><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Any"><span class="hs-identifier hs-var">Any</span></a></span></span><span>   </span><span class="annot"><a href="GHC.CmmToAsm.Format.html#Format"><span class="hs-identifier hs-type">Format</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Platform.Reg.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#InstrBlock"><span class="hs-identifier hs-type">InstrBlock</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-comment">-- | Change the format field in a Register.</span><span>
</span><span id="line-85"></span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#setFormatOfRegister"><span class="hs-identifier hs-type">setFormatOfRegister</span></a></span><span>
</span><span id="line-86"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Register"><span class="hs-identifier hs-type">Register</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Format.html#Format"><span class="hs-identifier hs-type">Format</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Register"><span class="hs-identifier hs-type">Register</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span id="setFormatOfRegister"><span class="annot"><span class="annottext">setFormatOfRegister :: Register -&gt; Format -&gt; Register
</span><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#setFormatOfRegister"><span class="hs-identifier hs-var hs-var">setFormatOfRegister</span></a></span></span><span> </span><span id="local-6989586621681009531"><span class="annot"><span class="annottext">Register
</span><a href="#local-6989586621681009531"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span id="local-6989586621681009530"><span class="annot"><span class="annottext">Format
</span><a href="#local-6989586621681009530"><span class="hs-identifier hs-var">format</span></a></span></span><span>
</span><span id="line-89"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Register
</span><a href="#local-6989586621681009531"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-90"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><span class="annottext">Format
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681009529"><span class="annot"><span class="annottext">Reg
</span><a href="#local-6989586621681009529"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span id="local-6989586621681009528"><span class="annot"><span class="annottext">InstrBlock
</span><a href="#local-6989586621681009528"><span class="hs-identifier hs-var">code</span></a></span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Format -&gt; Reg -&gt; InstrBlock -&gt; Register
</span><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Fixed"><span class="hs-identifier hs-var">Fixed</span></a></span><span> </span><span class="annot"><span class="annottext">Format
</span><a href="#local-6989586621681009530"><span class="hs-identifier hs-var">format</span></a></span><span> </span><span class="annot"><span class="annottext">Reg
</span><a href="#local-6989586621681009529"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="annot"><span class="annottext">InstrBlock
</span><a href="#local-6989586621681009528"><span class="hs-identifier hs-var">code</span></a></span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Any"><span class="hs-identifier hs-type">Any</span></a></span><span> </span><span class="annot"><span class="annottext">Format
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681009527"><span class="annot"><span class="annottext">Reg -&gt; InstrBlock
</span><a href="#local-6989586621681009527"><span class="hs-identifier hs-var">codefn</span></a></span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Format -&gt; (Reg -&gt; InstrBlock) -&gt; Register
</span><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#Any"><span class="hs-identifier hs-var">Any</span></a></span><span>   </span><span class="annot"><span class="annottext">Format
</span><a href="#local-6989586621681009530"><span class="hs-identifier hs-var">format</span></a></span><span> </span><span class="annot"><span class="annottext">Reg -&gt; InstrBlock
</span><a href="#local-6989586621681009527"><span class="hs-identifier hs-var">codefn</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Grab the Reg for a CmmReg</span><span>
</span><span id="line-96"></span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#getRegisterReg"><span class="hs-identifier hs-type">getRegisterReg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#Reg"><span class="hs-identifier hs-type">Reg</span></a></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span id="getRegisterReg"><span class="annot"><span class="annottext">getRegisterReg :: Platform -&gt; CmmReg -&gt; Reg
</span><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#getRegisterReg"><span class="hs-identifier hs-var hs-var">getRegisterReg</span></a></span></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-type">CmmLocal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span id="local-6989586621681009524"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681009524"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621681009523"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681009523"><span class="hs-identifier hs-var">pk</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VirtualReg -&gt; Reg
</span><a href="GHC.Platform.Reg.html#RegVirtual"><span class="hs-identifier hs-var">RegVirtual</span></a></span><span> </span><span class="annot"><span class="annottext">(VirtualReg -&gt; Reg) -&gt; VirtualReg -&gt; Reg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Format -&gt; VirtualReg
</span><a href="GHC.CmmToAsm.SPARC.Regs.html#mkVirtualReg"><span class="hs-identifier hs-var">mkVirtualReg</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681009524"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; Format
</span><a href="GHC.CmmToAsm.Format.html#cmmTypeFormat"><span class="hs-identifier hs-var">cmmTypeFormat</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681009523"><span class="hs-identifier hs-var">pk</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#getRegisterReg"><span class="hs-identifier hs-var">getRegisterReg</span></a></span><span> </span><span id="local-6989586621681009519"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009519"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-type">CmmGlobal</span></a></span><span> </span><span id="local-6989586621681009517"><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681009517"><span class="hs-identifier hs-var">mid</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; GlobalReg -&gt; Maybe RealReg
</span><a href="GHC.Platform.Regs.html#globalRegMaybe"><span class="hs-identifier hs-var">globalRegMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009519"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681009517"><span class="hs-identifier hs-var">mid</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681009515"><span class="annot"><span class="annottext">RealReg
</span><a href="#local-6989586621681009515"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; Reg
</span><a href="GHC.Platform.Reg.html#RegReal"><span class="hs-identifier hs-var">RegReal</span></a></span><span> </span><span class="annot"><span class="annottext">RealReg
</span><a href="#local-6989586621681009515"><span class="hs-identifier hs-var">reg</span></a></span><span>
</span><span id="line-104"></span><span>        </span><span class="annot"><span class="annottext">Maybe RealReg
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Reg
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span>
</span><span id="line-105"></span><span>                        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SPARC.CodeGen.Base.getRegisterReg: global is in memory&quot;</span></span><span>
</span><span id="line-106"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmReg -&gt; SDoc) -&gt; CmmReg -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-var">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681009517"><span class="hs-identifier hs-var">mid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-comment">-- Expand CmmRegOff.  ToDo: should we do it this way around, or convert</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- CmmExprs into CmmRegOff?</span><span>
</span><span id="line-111"></span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#mangleIndexTree"><span class="hs-identifier hs-type">mangleIndexTree</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span id="mangleIndexTree"><span class="annot"><span class="annottext">mangleIndexTree :: Platform -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#mangleIndexTree"><span class="hs-identifier hs-var hs-var">mangleIndexTree</span></a></span></span><span> </span><span id="local-6989586621681009511"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009511"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmRegOff"><span class="hs-identifier hs-type">CmmRegOff</span></a></span><span> </span><span id="local-6989586621681009509"><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681009509"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span id="local-6989586621681009508"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681009508"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_Add"><span class="hs-identifier hs-var">MO_Add</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681009505"><span class="hs-identifier hs-var">width</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681009509"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681009508"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681009505"><span class="hs-identifier hs-var">width</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-115"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681009505"><span class="annot"><span class="annottext">width :: Width
</span><a href="#local-6989586621681009505"><span class="hs-identifier hs-var hs-var">width</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmRegType"><span class="hs-identifier hs-var">cmmRegType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009511"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681009509"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="GHC.CmmToAsm.SPARC.CodeGen.Base.html#mangleIndexTree"><span class="hs-identifier hs-var">mangleIndexTree</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-118"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; CmmExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SPARC.CodeGen.Base.mangleIndexTree: no match&quot;</span></span><span>
</span><span id="line-119"></span></pre></body></html>